package com.markpim.dena.opdracht4;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class GraphVertex {

	private int inputCount;
	private int outputCount;
	private String name;
	private int vroegsteTijd;
	private int laatsteTijd;
	private List<GraphEdge> neighboursIn;
	private List<GraphEdge> neighboursOut;

	public GraphVertex(String name) {
		this.name = name;
		neighboursIn = new ArrayList<>();
		neighboursOut = new ArrayList<>();
	}

	public int getInputCount() {
		return inputCount;
	}

	public void setInputCount(int inputCount) {
		this.inputCount = inputCount;
	}
	
	public int getOutputCount() {
		return outputCount;
	}
	
	public void setOutputCount(int outputCount) {
		this.outputCount = outputCount;
	}

	public int getVroegsteTijd() {
		return vroegsteTijd;
	}

	public void setVroegsteTijd(int minimum) {
		this.vroegsteTijd = minimum;
	}

	public int getLaatsteTijd() {
		return laatsteTijd;
	}

	public void setLaatsteTijd(int maximum) {
		this.laatsteTijd = maximum;
	}

	public String getName() {
		return name;
	}

	public List<GraphEdge> getNeighboursIn() {
		return Collections.unmodifiableList(neighboursIn);
	}

	public List<GraphEdge> getNeighboursOut() {
		return Collections.unmodifiableList(neighboursOut);
	}

	public void addNeighbourIn(GraphEdge edge) {
		neighboursIn.add(edge);
	}

	public void addNeighbourOut(GraphEdge edge) {
		neighboursOut.add(edge);
	}

	public int decrementInputCount() {
		if (inputCount > 0)
			return --inputCount;
		else
			return inputCount;
	}
	
	public int decrementOutputCount() {
		if(outputCount > 0) {
			return --outputCount;
		}
		return outputCount;
	}

}